<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.sms.note.*, com.sms.servlet.*"%>
<%@ page import="net.sf.json.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
request.setCharacterEncoding("utf-8");	
String id=request.getParameter("id");
System.out.println(id);
int infoid=Integer.parseInt(id);
List<Map> jlist=new ArrayList<Map> ();
    	jlist=Note.querysigle(infoid);    
    	
    		 Map map1=jlist.get(0);
    		Note rep=new Note();   
    		rep.init(map1);		    		
 %>
 <body>
 <div>
  <center> <h4>标题：<%=rep.getTitle() %></h4>
	        <span>发布人：<%=map1.get("name")%>
	       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	      发布时间：<%=map1.get("notetime")%>&nbsp;&nbsp;&nbsp;&nbsp;浏览次数：<%=map1.get("readnum")%>
	                                        </span>	    
	                                        
	                                        </center> 
	                                        
<%
  String num=map1.get("readnum").toString();
  int number=Integer.parseInt(num)+1;
  Note.countupdate(number,infoid);
  

 %>	                                        
	                                        
	        
	        <p style="left:100px"><h4>正文：</h4>
	        <hr>
	        
<p>&nbsp;&nbsp;&nbsp;&nbsp;<%=map1.get("content") %> </p>	 


     <% 
     	List<Map> appendFile = null;
		//如果有附件
		if(rep.getIsappend().equals("1")) {
			appendFile = new ArrayList<Map>();
			appendFile = rep.getAppendFile();
     %>  
      		<tr class="addfiles"><td><label for="file">附件链接：</label></td>
      		<td style="text-align:left;height:30px;">
      <% 
      		for(int i=0; i<appendFile.size(); i++) {
      				Map<String, String> map = (Map<String, String>)appendFile.get(i);
      				String type=(String)map.get("type");
					String fileName = (String)map.get("fileName");
					String saveName = (String)map.get("saveName");
      %>
      		<p> 	<a href="DownServlet?fileName=<%= fileName %>&saveName=<%= saveName %>"><%=type+i+":"+fileName %></a>&nbsp;&nbsp;</p> 
      <%
      		}
      %>
      
      		
      <% }%> 

       
 
 
 </div>
</body>
 
 
